import App from './App'
import './styles/global.scss'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import share from './utils/share.js'
Vue.config.productionTip = false
Vue.mixin(share)
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
import share from './utils/share.js'

export function createApp () {
  const app = createSSRApp(App)
  // 状态管理
  const store = Pinia.createPinia()
  // 持久化
  app.use(store)
  app.mixin(share)
  return {
    app,
    Pinia
  }
}
// #endif
